<template>
	<view class="register">
		<view class="register-1">
			<text>手机号注册</text>
		</view>
		<view class="register-2">
			<input v-model="telephone" class="inp-1" type="text" value="" placeholder="请输入手机/邮箱" />
		</view>
		<view class="register-3">

			<navigator @click="to" class="button" url="">下一步</navigator>
			<u-top-tips ref="uTips"></u-top-tips>
		</view>
		<view class="register-4">
			<view class="wz-1">
				<navigator url="../Login/Login">账号密码登录</navigator>
			</view>
			<view class="wz-2">
				<navigator url="#">遇到问题</navigator>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		createNamespacedHelpers
	} from "vuex";
	const {
		mapActions,
		mapState,
		mapMutations
	} = createNamespacedHelpers(
		"user"
	);
	export default {
		data() {
			return {
				telephone: ''
			}
		},
		methods: {
			to() {
				let phone = /^1[3-9]\d{9}$/;
				let result = phone.test(this.telephone)
				if (result) {
					uni.navigateTo({
						url: "/pages/Register/Password?telephone=" + this.telephone
					})
				} else {
					this.$refs.uTips.show({
						title: '手机号格式错误',
						type: 'warning',
						duration: '2300'
					})
				}

			}
		}
	}
</script>

<style scoped lang="scss">
	.register {
		margin-top: 100rpx;

		width: 750rpx;
		height: 600rpx;
		box-sizing: border-box;
		padding: 0rpx 40rpx;

		// background-color: red;
		.register-1 {
			width: 100%;
			height: 40%;
			font-size: 54rpx;
			font-weight: 800;
			text-align: center;
			line-height: 290rpx;
		}

		.register-2 {
			width: 100%;
			height: 100rpx;
			border-radius: 15rpx;

			.inp-1 {
				width: 100%;
				height: 100%;
				font-size: 26rpx;
				font-weight: 800;
				padding-left: 25rpx;
				border-radius: 15rpx;
				color: #b9b9b9;
				background-color: #f5f5f5;
			}
		}

		.register-3 {
			margin-top: 20rpx;
			width: 100%;
			height: 85rpx;

			.button {
				line-height: 85rpx;
				text-align: center;
				border-radius: 15rpx;
				font-size: 28rpx;
				font-weight: 700;
				width: 100%;
				height: 100%;
				color: #FFFFFF;
				background-color: #3775f6;
			}
		}

		.register-4 {
			margin-top: 20rpx;
			width: 100%;
			height: 60rpx;
			display: flex;
			justify-content: space-between;
			line-height: 60rpx;

			.wz-1 {
				color: #3775f6;
			}

			.wz-2 {
				color: #3775f6;
			}
		}
	}
</style>
